package online.shenjian.redis.seckill.controller;

import online.shenjian.redis.seckill.service.SecKillService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * @author shenjian
 * @since 2022/11/12
 */
@RestController
public class SecKillController {

    private SecKillService secKillService;

    public SecKillController(SecKillService secKillService) {
        this.secKillService = secKillService;
    }

    @PostMapping(value = "/doSecKill", produces = MediaType.APPLICATION_JSON_VALUE)
    public String doSecKill(@RequestParam String userId, @RequestParam String productId) {
        return secKillService.doSecKill(userId, productId);
    }
}
